﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using Excel;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Reflection;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_CanhBaoHangTonKho : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("CKHienThi")]
        private System.Windows.Forms.CheckBox _CKHienThi;
        [AccessedThroughProperty("CmdCancel")]
        private System.Windows.Forms.Button _CmdCancel;
        [AccessedThroughProperty("CmdExel")]
        private System.Windows.Forms.Button _CmdExel;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("VSlist")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlist;
        private IContainer components;
        public System.Data.DataTable objData;

        [DebuggerNonUserCode]
        public Frm_CanhBaoHangTonKho()
        {
            base.Load += new EventHandler(this.Frm_CanhBaoHangTonKho_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.InitializeComponent();
        }

        private void CmdCancel_Click(object sender, EventArgs e)
        {
            if (!this.CKHienThi.Checked)
            {
                modGeneral.H_CANHBAOHANGTONKHO = true;
            }
            this.Dispose();
        }

        private void CmdExel_Click(object sender, EventArgs e)
        {
            if (this.VSlist.Rows.Count != 1)
            {
                try
                {
                    SaveFileDialog dialog = new SaveFileDialog {
                        Filter = "Excel Files|*.xls",
                        Title = "Save an Excel file"
                    };
                    dialog.ShowDialog();
                    if (dialog.FileName != "")
                    {
                        this.VSlist.SaveExcel(dialog.FileName, "HangTonDuoiDinhMuc", FileFlags.IncludeFixedCells);
                        Excel.Application application = new ApplicationClass();
                        Workbook workbook = application.Workbooks.Open(dialog.FileName, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
                        application.Visible = true;
                    }
                }
                catch (COMException exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    COMException exception = exception1;
                    MessageBox.Show(exception.Message);
                    ProjectData.ClearProjectError();
                }
                catch (Exception exception3)
                {
                    ProjectData.SetProjectError(exception3);
                    Exception exception2 = exception3;
                    MessageBox.Show(exception2.Message);
                    ProjectData.ClearProjectError();
                }
            }
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing && (this.components != null))
                {
                    this.components.Dispose();
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }

        private void Frm_CanhBaoHangTonKho_Load(object sender, EventArgs e)
        {
            modGeneral.H_CANHBAOHANGTONKHO = false;
            this.VSlist.DataSource = this.objData;
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            vSlist.Cols[0].Caption = modGeneral.Tranlated("M\x00e3 h\x00e0ng", "");
            vSlist.Cols[1].Caption = modGeneral.Tranlated("T\x00ean h\x00e0ng", "");
            vSlist.Cols[2].Caption = modGeneral.Tranlated("ĐVT", "");
            vSlist.Cols[3].Caption = modGeneral.Tranlated("Tồn tối thiểu", "");
            vSlist.Cols[4].Caption = modGeneral.Tranlated("Số lượng tồn", "");
            vSlist.Cols[0].Width = 0x73;
            vSlist.Cols[1].Width = 350;
            vSlist.Cols[2].Width = 80;
            vSlist.Cols[3].Width = 80;
            vSlist.Cols[3].Format = modGeneral.H_FORMATNUMBER + ".00";
            vSlist.Cols[4].Format = modGeneral.H_FORMATNUMBER + ".00";
            vSlist = null;
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_CanhBaoHangTonKho));
            this.Panel1 = new Panel();
            this.CKHienThi = new System.Windows.Forms.CheckBox();
            this.CmdCancel = new System.Windows.Forms.Button();
            this.CmdExel = new System.Windows.Forms.Button();
            this.VSlist = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.Panel1.SuspendLayout();
            this.VSlist.BeginInit();
            this.SuspendLayout();
            this.Panel1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel1.Controls.Add(this.CKHienThi);
            this.Panel1.Controls.Add(this.CmdCancel);
            this.Panel1.Controls.Add(this.CmdExel);
            this.Panel1.Dock = DockStyle.Top;
            System.Drawing.Point point = new System.Drawing.Point(0, 0);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            Size size = new Size(740, 0x24);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0;
            this.CKHienThi.AutoSize = true;
            this.CKHienThi.BackColor = Color.Transparent;
            point = new System.Drawing.Point(12, 11);
            this.CKHienThi.Location = point;
            this.CKHienThi.Name = "CKHienThi";
            size = new Size(0x5f, 0x11);
            this.CKHienThi.Size = size;
            this.CKHienThi.TabIndex = 0x56;
            this.CKHienThi.Text = "Ngưng hiển thị";
            this.CKHienThi.UseVisualStyleBackColor = false;
            this.CmdCancel.DialogResult = DialogResult.Cancel;
            this.CmdCancel.Image = ACCOUNTING.My.Resources.Resources.Closed;
            this.CmdCancel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(0x284, 6);
            this.CmdCancel.Location = point;
            this.CmdCancel.Name = "CmdCancel";
            size = new Size(0x4d, 0x18);
            this.CmdCancel.Size = size;
            this.CmdCancel.TabIndex = 0x55;
            this.CmdCancel.Text = "Th&o\x00e1t";
            this.CmdCancel.UseVisualStyleBackColor = true;
            this.CmdExel.Image = (Image) manager.GetObject("CmdExel.Image");
            this.CmdExel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(0x22f, 6);
            this.CmdExel.Location = point;
            this.CmdExel.Name = "CmdExel";
            size = new Size(80, 0x18);
            this.CmdExel.Size = size;
            this.CmdExel.TabIndex = 0x54;
            this.CmdExel.Text = "&Excel";
            this.CmdExel.UseVisualStyleBackColor = true;
            this.VSlist.AllowEditing = false;
            this.VSlist.AutoResize = false;
            this.VSlist.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.XpThemes;
            this.VSlist.ColumnInfo = manager.GetString("VSlist.ColumnInfo");
            this.VSlist.Dock = DockStyle.Fill;
            this.VSlist.ExtendLastCol = true;
            this.VSlist.FocusRect = FocusRectEnum.None;
            point = new System.Drawing.Point(0, 0x24);
            this.VSlist.Location = point;
            this.VSlist.Name = "VSlist";
            this.VSlist.Rows.Count = 1;
            this.VSlist.Rows.DefaultSize = 0x11;
            this.VSlist.SelectionMode = SelectionModeEnum.Row;
            size = new Size(740, 0x1e8);
            this.VSlist.Size = size;
            this.VSlist.StyleInfo = manager.GetString("VSlist.StyleInfo");
            this.VSlist.TabIndex = 5;
            this.VSlist.VisualStyle = VisualStyle.Office2007Blue;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(740, 0x20c);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.VSlist);
            this.Controls.Add(this.Panel1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Frm_CanhBaoHangTonKho";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "CANH BAO HANG TON DUOI DINH MUC";
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            this.VSlist.EndInit();
            this.ResumeLayout(false);
        }

        internal virtual System.Windows.Forms.CheckBox CKHienThi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKHienThi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKHienThi = value;
            }
        }

        internal virtual System.Windows.Forms.Button CmdCancel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCancel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdCancel_Click);
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click -= handler;
                }
                this._CmdCancel = value;
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdExel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExel_Click);
                if (this._CmdExel != null)
                {
                    this._CmdExel.Click -= handler;
                }
                this._CmdExel = value;
                if (this._CmdExel != null)
                {
                    this._CmdExel.Click += handler;
                }
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlist
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlist;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._VSlist = value;
            }
        }
    }
}

